package com.gitee.ywj1352.guva;

import com.google.common.io.ByteSource;
import com.google.common.io.FileWriteMode;
import com.google.common.io.Files;
import org.junit.Test;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * @author wenjie.yang on 2019/11/14.
 */
public class IODemo {

    @Test
    public void testByteStreams1(){

        ByteSource byteSource = Files.asByteSource(new File("C:\\Users\\wenjie.yang\\Desktop\\report.json"));
        Files.asByteSink(new File("C:\\Users\\wenjie.yang\\Desktop\\ooooooooooooooo.json"), FileWriteMode.APPEND);
        try {
            byteSource.copyTo(new FileOutputStream("C:\\Users\\wenjie.yang\\Desktop\\ooooooooooooooo.json"));

        } catch (IOException e) {
            e.printStackTrace();
        }

    }

}
